<template>
  <div class="layout">
    <div class="nav"></div>
    <div class="slide">
      <a-menu :defaultSelectedKeys="['dashboard']" mode="inline" theme="dark">
        <a-menu-item key="dashboard">
          <a-icon type="pie-chart" />
          <span>Dashboard</span>
        </a-menu-item>

        <a-sub-menu key="posts">
          <span slot="title">
            <a-icon type="mail" />
            <span>文章操作</span>
          </span>
          <a-menu-item key="posts-list">
            <router-link to="/post/list">
              文章列表
            </router-link>
          </a-menu-item>
          <a-menu-item key="posts-add">
            <router-link to="/post/add">
              添加文章
            </router-link>
          </a-menu-item>
        </a-sub-menu>

        <a-sub-menu key="shop">
          <span slot="title">
            <a-icon type="mail" />
            <span>商城操作</span>
          </span>
          <a-menu-item key="shop-list">
            <router-link to="/shop/list">
              商品列表
            </router-link>
          </a-menu-item>
          <a-menu-item key="shop-brand">
            <router-link to="/shop/brand/add">
              添加品牌
            </router-link>
          </a-menu-item>
          <a-menu-item key="shop-cat">
            <router-link to="/shop/cat/add">
              添加分类
            </router-link>
          </a-menu-item>
          <a-menu-item key="shop-express">
            <router-link to="/shop/express/add">
              添加快递
            </router-link>
          </a-menu-item>
        </a-sub-menu>
      </a-menu>
    </div>
    <div class="main">
      <div class="main-container">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {}
</script>

<style scoped lang="scss">
.layout {
  .nav {
    height: 50px;
    background: #000;
    position: fixed;
    top: 0;
    left: 256px;
    right: 0;
  }
  .slide {
    position: fixed;
    top: 0;
    left: 0;
    width: 256px;
    bottom: 0;
    background-color: #001529;
  }
  .main {
    position: fixed;
    left: 256px;
    right: 0;
    top: 50px;
    bottom: 0;
    background: rgba(0, 0, 0, .1);
    display: flex;
    &-container{
      flex: 1;
      background: #fff;
      margin: 20px;
      overflow: auto;
    }
  }
}
</style>
